<?xml version="1.0"?>

<!--
  This is a very simple config file with many options missing. For a complete
  set of options with comments, see docs/rc.xml.all
-->

<labwc_config>

<!-- гапсы / декорации / адаптивная синхронизация / Окно которое открывается по alt+tab -->  
  <core>
    <gap>10</gap>
    <decoration>server</decoration>
    <adaptiveSync>yes</adaptiveSync>
    <reuseOutputMode>yes</reuseOutputMode>
    <windowSwitcher show="yes" preview="yes" outlines="no" />
   </core>


<!-- тема labwc / скругления / шрифт -->  
  <theme>
    <name></name>
    <cornerRadius>12</cornerRadius>
    <font name="JetBrainsMono" size="10" />
  </theme>


<!-- кейбинды -->  
  <keyboard>
    <repeatRate>25</repeatRate>
    <repeatDelay>600</repeatDelay>

<!-- приложения -->
    <keybind key="W-Return">
      <action name="Execute" command="alacritty" />
    </keybind>
    <keybind key="W-n">
      <action name="Execute" command="nemo" />
    </keybind>
    <keybind key="W-i">
      <action name="Execute" command="inkscape" />
    </keybind>
    <keybind key="W-b">
      <action name="Execute" command="blender" />
    </keybind>
    <keybind key="W-l">
      <action name="Execute" command="lutris" />
    </keybind>
    <keybind key="W-d">
      <action name="Execute" command="wofi --show drun -I" />
    </keybind>
    <keybind key="Print">
      <action name="Execute" command="grim" />
    </keybind>

<!-- управление окнами -->
    <keybind key="A-Tab">
      <action name="NextWindow" />
    </keybind>
    <keybind key="A-F4">
      <action name="Close" />
    </keybind>
    <keybind key="W-a">
      <action name="ToggleMaximize" />
    </keybind>
    <keybind key="A-Left">
      <action name="MoveToEdge" direction="left" />
    </keybind>
    <keybind key="A-Right">
      <action name="MoveToEdge" direction="right" />
    </keybind>
    <keybind key="A-Up">
      <action name="MoveToEdge" direction="up" />
    </keybind>
    <keybind key="A-Down">
      <action name="MoveToEdge" direction="down" />
    </keybind>

<!-- прилипание окон к сторонам экрана -->
    <keybind key="W-Left">
      <action name="SnapToEdge" direction="left" />
    </keybind>
    <keybind key="W-Right">
      <action name="SnapToEdge" direction="right" />
    </keybind>
    <keybind key="W-Up">
      <action name="SnapToEdge" direction="up" />
    </keybind>
    <keybind key="W-Down">
      <action name="SnapToEdge" direction="down" />
    </keybind>

<!-- показать меню окна приложения -->
    <keybind key="A-Space">
      <action name="ShowMenu" menu="client-menu" />
    </keybind>

<!-- специальные клавиши -->
    <keybind key="XF86_AudioLowerVolume">
      <action name="Execute" command="amixer sset Master 5%-" />
    </keybind>
    <keybind key="XF86_AudioRaiseVolume">
      <action name="Execute" command="amixer sset Master 5%+" />
    </keybind>
    <keybind key="XF86_AudioMute">
      <action name="Execute" command="amixer sset Master toggle" />
    </keybind>
    <keybind key="XF86_MonBrightnessUp">
      <action name="Execute" command="brightnessctl set +10%" />
    </keybind>
    <keybind key="XF86_MonBrightnessDown">
      <action name="Execute" command="brightnessctl set 10%-" />
    </keybind>

<!-- Перемещение приложения на воркспейс -->
    <keybind key="W-S-1">
      <action name="SendToDesktop">
        <to>1</to>
      </action>
    </keybind>
    <keybind key="W-S-2">
      <action name="SendToDesktop">
        <to>2</to>
      </action>
    </keybind>
    <keybind key="W-S-3">
      <action name="SendToDesktop">
        <to>3</to>
      </action>
    </keybind>
    <keybind key="W-S-4">
      <action name="SendToDesktop">
        <to>4</to>
      </action>
    </keybind>
    <keybind key="W-S-5">
      <action name="SendToDesktop">
        <to>5</to>
      </action>
    </keybind>

<!-- Переключение воркспейсов -->
    <keybind key="W-1">
      <action name="GoToDesktop">
        <to>1</to>
      </action>
    </keybind>
    <keybind key="W-1">
      <action name="GoToDesktop">
        <to>2</to>
      </action>
    </keybind>
    <keybind key="W-1">
      <action name="GoToDesktop">
        <to>3</to>
      </action>
    </keybind>
    <keybind key="W-1">
      <action name="GoToDesktop">
        <to>4</to>
      </action>
    </keybind>
    <keybind key="W-1">
      <action name="GoToDesktop">
        <to>5</to>
      </action>
    </keybind>

<!-- Настройка прилипания окна к углам экрана -->
    <keybind key="W-KP_7"><action name="SnapToRegion" region="top-left" /></keybind>
    <keybind key="W-KP_8"><action name="SnapToRegion" region="top" /></keybind>
    <keybind key="W-KP_9"><action name="SnapToRegion" region="top-right" /></keybind>
    <keybind key="W-KP_4"><action name="SnapToRegion" region="left" /></keybind>
    <keybind key="W-KP_5"><action name="SnapToRegion" region="center" /></keybind>
    <keybind key="W-KP_6"><action name="SnapToRegion" region="right" /></keybind>
    <keybind key="W-KP_1"><action name="SnapToRegion" region="bottom-left" /></keybind>
    <keybind key="W-KP_2"><action name="SnapToRegion" region="bottom" /></keybind>
    <keybind key="W-KP_3"><action name="SnapToRegion" region="bottom-right" /></keybind>

<!-- Удалить привязку <keybind key="W-F4" /> -->
    <keybind key="W-F4">
      <action name="None" />
    </keybind>

  </keyboard>
  
<!-- Настройка прилипания окна к углам экрана -->
    <regions>
      <region name="top-left"     x="0%"  y="0%"  height="50%"  width="50%"  />
      <region name="top"          x="0%"  y="0%"  height="50%"  width="100%" />
      <region name="top-right"    x="50%" y="0%"  height="50%"  width="50%"  />
      <region name="left"         x="0%"  y="0%"  height="100%" width="50%"  />
      <region name="center"       x="10%" y="10%" height="80%"  width="80%"  />
      <region name="right"        x="50%" y="0%"  height="100%" width="50%"  />
      <region name="bottom-left"  x="0%"  y="50%" height="50%"  width="50%"  />
      <region name="bottom"       x="0%"  y="50%" height="50%"  width="100%" />
      <region name="bottom-right" x="50%" y="50%" height="50%"  width="50%"  />
    </regions>


<!-- фокус при наведении -->
  <focus>
    <followMouse>yes</followMouse>
    <raiseOnFocus>no</raiseOnFocus>
  </focus>

<!-- edge strength is in pixels -->
  <resistance>
    <screenEdgeStrength>20</screenEdgeStrength>
  </resistance>

<!-- Включение привязки, хз что к чему привязывается, не нашел -->
  <snapping>
    <range>1</range>
    <topMaximize>no</topMaximize>
  </snapping>

<!-- Настройки мыши -->
  <mouse>
    <default />
    <!-- Показать меню по пкм -->
    <context name="Root">
      <mousebind button="Right" action="Press">
        <action name="ShowMenu" menu="some-custom-menu" />
      </mousebind>
    </context>
  </mouse>

<!-- Воркспейсы и попапы -->
    <desktops>
      <popupTime>1000</popupTime>
      <names>
        <name>1</name>
        <name>2</name>
        <name>3</name>
        <name>4</name>
        <name>5</name>
      </names>
    </desktops>

<!-- Тачпад -->
  <libinput>
    <device category="">
      <naturalScroll></naturalScroll>
      <leftHanded></leftHanded>
      <pointerSpeed></pointerSpeed>
      <accelProfile></accelProfile>
      <tap>yes</tap>
      <tapButtonMap></tapButtonMap>
      <middleEmulation></middleEmulation>
      <disableWhileTyping></disableWhileTyping>
    </device>
  </libinput>

<!-- Манипулятор мышь -->
  <mouse>

<!-- Временной промежуток при двойном клике -->
    <doubleClickTime>500</doubleClickTime>

<!-- Изменение размера окна и перемещение -->
    <context name="Frame">
      <mousebind button="A-Left" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
      <mousebind button="A-Left" action="Drag">
        <action name="Move" />
      </mousebind>
      <mousebind button="A-Right" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
      <mousebind button="A-Right" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>

    <context name="Top">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="Left">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="Right">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="Bottom">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="TRCorner">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="BRCorner">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="TLCorner">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>
    <context name="BLCorner">
      <mousebind button="Left" action="Drag">
        <action name="Resize" />
      </mousebind>
    </context>

<!-- Что будет если тыкать на заголовке окна -->
    <context name="TitleBar">
      <mousebind button="Left" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
      <mousebind button="Right" action="Click">
        <action name="Focus" />
        <action name="Raise" />
        <action name="ShowMenu" menu="client-menu" />
      </mousebind>
    </context>

<!-- Перемещение окна за заголовок -->
    <context name="Title">
      <mousebind button="Left" action="Drag">
        <action name="Move" />
      </mousebind>
      <mousebind button="Left" action="DoubleClick">
        <action name="ToggleMaximize" />
      </mousebind>
    </context>

<!-- Кнопки свернуть/развернуть/закрыть -->
    <context name="Maximize">
      <mousebind button="Left" action="Click">
        <action name="Focus" />
        <action name="Raise" />
        <action name="ToggleMaximize" />
      </mousebind>
    </context>

    <context name="WindowMenu">
      <mousebind button="Left" action="Click">
        <action name="ShowMenu" menu="client-menu" />
      </mousebind>
    </context>

    <context name="Iconify">
      <mousebind button="left" action="Click">
        <action name="Iconify" />
      </mousebind>
    </context>

    <context name="Close">
      <mousebind button="Left" action="Click">
        <action name="Close" />
      </mousebind>
    </context>

<!-- Перемещение окна за заголовок -->
    <context name="Client">
      <mousebind button="Left" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
      <mousebind button="Middle" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
      <mousebind button="Right" action="Press">
        <action name="Focus" />
        <action name="Raise" />
      </mousebind>
    </context>

<!-- Меню на рабочем столе и переключение воркспейсов -->
    <context name="Root">
      <mousebind button="Left" action="Press">
        <action name="" menu="" />
      </mousebind>
      <mousebind direction="Up" action="Scroll">
        <action name="GoToDesktop" to="left" />
      </mousebind>
      <mousebind direction="Down" action="Scroll">
        <action name="GoToDesktop" to="right" />
      </mousebind>
    </context>

  </mouse>

</labwc_config>
